<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
	<head>
		<title>后台管理系统</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="robots" content="nofollow"/>
		<link href="/css/adminStyle.css" rel="stylesheet" type="text/css" />
		<style>
			body{
				width:100%;
				height:100%;
				overflow:hidden;
				background:url(/images/pc_loginBg.jpg) no-repeat;
				background-size:cover;
				position:absolute;
				}
		</style>
		<script src="/js/jquery.js"></script>
		<script src="/js/Particleground.js"></script>
		<script type="text/javascript" src="/js/axios.min.js"></script>
		<script type="text/javascript" src="/js/vue.js"></script>
		<script>
			$(document).ready(function() {
				$('body').particleground({
					dotColor:'green',
					lineColor:'#c9ec6e'
				});
				$('.intro').css({
					'margin-top': -($('.intro').height() /2)
				});
			});
		</script>
		<script>
			$(document).keydown(function (event) {
				if (event.keyCode == 13) {
					$("#loginadmin").click();
				}
			});
		</script>
	</head>
	<body>
		<section class="loginform" id="login">
			<h1>后台管理系统</h1>
			<ul>
				<li>
					<label>账号：</label>
					<input type="text" id="account" class="textBox" autofocus placeholder="管理员账号"/>
				</li>
				<p class="msg" style="color: red"></p>
				<li>
					<label>密码：</label>
					<input type="password" id="password" class="textBox" placeholder="登陆密码"/>
				</li>
				<li>
					<input type="button" id="loginadmin" v-on:click="login" value="立即登陆"/>
				</li>
			</ul>
		</section>
		<script>
			var vue = new Vue({
				el:"#login",
				data:{},
				methods:{
					login:function () {
						let	adminAccount = $("#account").val();
						let	adminPassword = $("#password").val();
						let url = "admin/login?adminAccount="+adminAccount+"&adminPassword="+adminPassword;
						axios.get(url)
						.then(function (result) {
							if (result.data.status==200){
								window.location.href = "backStage/index";
							}else {
								$(".msg").html(result.data.msg);
							}
						})
						.catch();
					}
				},
			})
		</script>
	</body>
</html>